<template>
	<view style="background-color: #FFFFFF;">
		<!-- Tab导航 -->
		<view class="tab-container">
			<view class="tab-item" :class="{ 'active': currentTab === 0 }" @click="switchTab(0)">
				售后申请
			</view>
			<view class="tab-item" :class="{ 'active': currentTab === 1 }" @click="switchTab(1)">
				申请中
			</view>
			<view class="tab-item" :class="{ 'active': currentTab === 2 }" @click="switchTab(2)">
				申请记录
			</view>
		</view>
		
		<!-- 搜索栏 -->
		<view class="search-container">
			<view class="search-box">
				<u-icon name="search" color="#999" size="18" style="margin-right: 8px;"></u-icon>
				<input 
					class="search-input" 
					placeholder="请输入订单编号/商品名称/售后单号" 
					v-model="searchText"
					@confirm="handleSearch"
				/>
			</view>
			<text class="search-text" @click="handleSearch">搜索</text>
		</view>
		
		<!-- 内容区域 -->
		<view class="content">
			<view v-if="currentTab === 0">
				<!-- 售后申请内容 -->
				<view class="empty-content">
					<text class="empty-text">没有更多了</text>
				</view>
			</view>
			<view v-else-if="currentTab === 1">
				<!-- 申请中内容 -->
				<view class="empty-content">
					<text class="empty-text">暂无申请中的售后</text>
				</view>
			</view>
			<view v-else-if="currentTab === 2">
				<!-- 申请记录内容 -->
				<view class="empty-content">
					<text class="empty-text">暂无申请记录</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				currentTab: 0, // 默认选中售后申请
				searchText: ''
			}
		},
		methods: {
			switchTab(index) {
				this.currentTab = index;
				console.log('切换到tab:', index);
			},
			handleSearch() {
				console.log('搜索内容:', this.searchText);
				uni.showToast({
					title: '搜索功能开发中',
					icon: 'none'
				});
			}
		}
	}
</script>

<style>
.tab-container {
	display: flex;
	background-color: #FFFFFF;
	padding: 15px 0;
	border-bottom: 1px solid #F0F0F0;
}

.tab-item {
	flex: 1;
	text-align: center;
	font-size: 14px;
	color: #666666;
	padding: 8px 0;
	position: relative;
}

.tab-item.active {
	color: #333333;
	font-weight: bold;
}

.tab-item.active::after {
	content: '';
	position: absolute;
	bottom: -15px;
	left: 50%;
	transform: translateX(-50%);
	width: 20px;
	height: 2px;
	background-color: #333333;
}

.search-container {
	display: flex;
	align-items: center;
	padding: 15px;
	gap: 10px;
}

.search-box {
	flex: 1;
	display: flex;
	align-items: center;
	background-color: #F5F5F5;
	border-radius: 20px;
	padding: 10px 15px;
}

.search-input {
	flex: 1;
	font-size: 14px;
	color: #333;
	background: transparent;
	border: none;
	outline: none;
}

.search-input::placeholder {
	color: #999999;
}



.content {
	padding: 20px;
	background-color: #F8F8F8;
}

.empty-content {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 50px 0;
}

.empty-text {
	color: #999999;
	font-size: 14px;
}

.search-text {
	color: #333;
	font-size: 14px;
	padding: 10px 15px;
}
</style>
